package com.nsoft.html5npub.utils;

public class Constant {
	public static final String EMPTY="";
	public static final String CHR_REPLACE="%s";
	public static final String CHR_SHARP="#";
	public static final String PATH_SPLITTER="/";
	public static final String URL_PREFIX="file://";
	public static final String PATH_DOT=".";
	public static final String CHR_LINEBREAK="\r\n";
	public static final String CHR_POPUPTYPE_DELIMITER="|";
	public static final String CHR_AND="&";
	public static final String CHR_EQUAL="=";
	public static final String CHR_SMALLSIZE_REMARK="s";
	public static final String CHR_QUOTE="\"";
	public static final String STR_XML="xml";
	public static final String STR_JS="js";
	public static final String STR_UTF8="UTF-8";
	
	public static final float DEFAULT_SCALED_DENSITY=1f;
	
	
	public static final String DIALOG_CONFIRM="confirm";
	public static final String DIALOG_ALERT="alert";
	public static final String DIALOG_ERROR="error";
	public static final String DIALOG_YES="yes";
	public static final String DIALOG_NO="no";
	public static final String DIALOG_OK="ok";
	
	public static final String DOWNLOADED_TRUE="true";
	public static final String DOWNLOADED_FALSE="false";
	
	public static final String UTIL_SDCARD_BASEFOLDER_NAME="pv_data";
	public static final String UTIL_SDCARD_BOOKFOLDER_NAME="books";
	public static final String UTIL_SDCARD_HISTORYFOLDER_NAME="history";
	public static final String UTIL_SDCARD_THUMBFOLDER_NAME="thumbs";
	public static final String UTIL_SDCARD_ICONFOLDER_NAME="icon";
	public static final String UTIL_SERVER_APPLICATION="dms";
	public static final String UTIL_HTML="html";
	
	public static final String UTIL_BOOKLIST_HISTORY_FILE="booklist_history.xml";
	
	public static class bmp {
		public static final int WIDTH=75;
		public static final int HEIGHT=100;
		public static final int QUALITY=95;
		public static final String EXTENSION="png";
	}
	
	public static class pagesize{
		public static final int WIDTH=768;
		public static final int HEIGHT=1024;
		public static final float RATE=0.75f;
	}
	
	public static class settingtags{
		public static final String ROOT_TAG="settings";
		public static final String SERVER_NAME_TAG="serverName";
		public static final String APPNAME_TAG="appName";
		public static final String DOWNLOAD_URL_TAG="downloadUrl";
		public static final String ICONURL_TAG="iconUrl";
		public static final String APPID_PARAM="appId";
	}
	
	public static class dataserver{
		public static final String SERVER_PROTOCOL="http://";
		/**
		public static final String SERVER_BOOKLIST_PARAMS="linkageproject.htm?language=1";
		public static final String SERVER_ICONLIST_PARAMS="dmsfile/icon/icon.zip";
		*/
		public static final int SERVER_CONNECT_TIMEOUT=15*1000;
		public static final int SERVER_CODE_OK=200;
		
		public static final String ERROR_RESPONSE_INCORRECT="server returns code number "+CHR_REPLACE;
		public static final String ERROR_RESPONSE_STREAM_UNAVAILABLE="server stream response is not available. please synchronize later";
		
		public static final String ERROR_NETWORK_TITLE="network problem";
		public static final String ERROR_NETWORK_UNAVAILABLE="network is unavailable now. please check again your wifi connection";
	}
	
	public static class xml {
		public static final String XML_TAG_DMSINFO="dmsInfo";
		public static final String XML_TAG_CONTENTS="contents";
		public static final String XML_TAG_CONTENT="content";
		public static final String XML_TAG_CONTENTNAME="contentsName";
		public static final String XML_TAG_CONTENTID="contentsId";
		public static final String XML_TAG_DOWNLOADPATH="downloadPath";
		public static final String XML_TAG_FILENAME="filename";
		public static final String XML_TAG_IMGPATH="imgPath";
		public static final String XML_TAG_VERSION="version";
		public static final String XML_TAG_STATE="state";
		public static final String XML_TAG_REDOWNLOAD="reDownload";
		public static final String XML_TAG_DOWNLOADED="downloaded";
		
		public static final String XML_BOOK_CONFIG_FILE="iPadPageInfo.xml";
		public static final String XML_BOOK_PREVIEW_FILE="previewInfo.xml";
		public static final String XML_CONFIG_TAG_PAGE="page";
		public static final String XML_CONFIG_TAG_PAGEID="pageid";
		public static final String XML_CONFIG_TAG_PAGEINDEX="pageindex";
		public static final String XML_CONFIG_TAG_PAGENAME="pagename";
		public static final String XML_CONFIG_TAG_STORYNAME="storyname";
		
		public static final String XML_CONFIG_TAG_VIDEO="video";
		public static final String XML_CFTAG_AUTOPLAY="autoPlay";
		public static final String XML_CFTAG_HEIGHT="pheight";
		public static final String XML_CFTAG_WIDTH="pwidth";
		public static final String XML_CFTAG_X="px";
		public static final String XML_CFTAG_Y="py";
		public static final String XML_CFTAG_FILENAME="videoFileName";
	}
	
	public static class utils{
		public static final String UTIL_ZOOM_METATAG="<meta name=\"viewport\".*?/>";
		public static final String UTIL_ZOOM_METATAG1="<meta name=\"viewport\" content=\"width=device-width,target-densitydpi="+CHR_REPLACE+"\" />";
		/**
		public static final String UTIL_ZOOM_METATAG1="<meta name=\"viewport\" content=\"width=device-width,target-densitydpi=device-dpi\" />";
		*/
		public static final String UTIL_ZOOM_METATAG2="<meta name=\"viewport\" content=\"width="+pagesize.WIDTH+",minimum-scale="+CHR_REPLACE+"\" />";
		public static final String UTIL_TYPE_REMOVAL="type=\"video/mp4\"";
		
		public static final String JS_PATTERN="(?i)(?:<[ \n\r]*script[^>]*>)(.*?)(?:<[ \n\r]*/script[^>]*>)";
		public static final String XML_JS_TAG="js";
		public static final String XML_JSFILES="jsfiles";
		public static final String XML_JSFILE="file";
		public static final String XML_JSCODE="jscode";
		public static final String JS_LINKED_FILE="<script src=\"";
		public static final String JS_CODE_TAG="<script type=\"text/javascript\">";
		public static final String JS_CODE_ENDTAG="</script>";
		public static final String JS_SUPPLIER_FILE="supplier.js";
	}
	
	public static class business{
		public static final String INFO_DELETE_FROMDB="deleting from database...";
		public static final String INFO_DELETE_FROM_STORAGE="deleting from storage...";
		public static final String INFO_REARRANGE_LIST="re-arrange list...";
		public static final String DELETE_FROMDB_FAILED="delete book from database has failed";
	}
	
	public static class booklist{
		public static final String BLF_SELECT_LISTENER_NOT_IMPLEMENTED=
							"the activity [%s] must implement "+
							"the BookSelectListener interface";
		public static final String BLF_CURRENT_POSITION="currentPosition";
		public static final String BLF_SERVER_UPDATE="update";
		public static final String BLF_SERVER_SYNC_CONFIRM="are you sure you want to synchronize with server?";
		public static final String BLF_SERVER_SYNCHRONIZE="synchronizing with server...";
		public static final String BLF_BOOKLIST_SYNCHRONIZE="synchronizing with bookstore...";
		
		public static final String BLF_LOAD_FROMLOCAL_FAILED="retrieving books from local failed. please resync from server";
		public static final String BLF_LOAD_FROMSERVER_FAILED="retrieving books from server failed. please check your network";
	
		public static final String BLF_CFM_DOWNLOAD="are you sure you want to download this book?";
		public static final String BLF_CFM_DELETE="are you sure you want to delete this book?";
		public static final String BLF_CFM_REDOWNLOAD="the book has been downloaded. do you want to re-download?";
		public static final String BLF_ERROR_DELETE_FOLDER_FAILED="cannot delete the old content of the book. please check the app permission or file system setting";
		public static final String BLF_ERROR_DOWNLOADING_FAILED="downloading the book failed. please check if the book is available or network problem";
		public static final String BLF_DOWNLOAD_DONE="download completed";
		public static final String BLF_FILE_DOWNLOADING="downloading...";
		public static final String ELF_DOWNLOAD_EXTRACTING="extracting content...";
		public static final String ELF_DOWNLOAD_SAVETO_DB="saving book...";
		public static final String BLF_BOOK_LOADING="book loading...";
		
		public static final String BOOK_INDEX_TRANSFER="book_index";
		
		public static final String BLA_CFM_QUIT="are you sure you want to quit?";
		public static final String BLF_QUIT_BOOKVIEW="are you sure you want to quit the view?";
		
		public static final String BLF_BOOK_NOT_AVAILABLE="this books has not been downloaded yet";
		
	}
	
	public static class newbooks{
		public static final int NEW_BOOK_NUMBER=5;
		public static final int IMG_SIZE_WIDTH=250;
		public static final int IMG_SIZE_HEIGHT=200;
	}
	
	public static class db{
		public static final String DB_NAME="pv_db";
		public static final int DB_VERSION = 1;
		public static final String DB_TABLE_BOOKS="books";
		public static final String DB_TABLE_BOOKMARK="bookmark";
		public static final String DB_BOOKMARK_PAGEINDEX_X="pageX";
		public static final String DB_BOOKMARK_PAGEINDEX_Y="pageY";
		
	}
	
	public static class view{
		public static final String URL_TYPE_POPUP="POPUP";
		public static final String URL_TYPE_FULLPOPUP="FULLPOPUP";
		public static final String URL_TYPE_CLOSE="CLOSE";
		public static final String URL_TYPE_MOVIE="MOVIE";
		public static final String URL_TYPE_PAGE="PAGE";
		public static final String URL_TYPE_MAP="MAP";
		public static final String URL_TYPE_WEBVIEW="WEBVIEW";
		public static final String URL_TYPE_SAFARI="SAFARI";
		public static final String URL_TYPE_SAFARI2="SAFARI2";
		public static final String URL_TYPE_HTML="HTML";
		public static final String URL_TYPE_APPSTORE="APPSTORE";
	}
	
	public static class grid{
		public static final int NUM_BOOKS_ON_SINGLEGRID=9;
		public static final int NUM_BOOKS_PER_LINE=3;
		
		public static final int SCALE_TOP_H800=30;
		public static final int SCALE_CELL_H800=185;
		public static final int SCALE_IMAGE_H800=133;
		
		public static final int SCALE_TOP_H1280=95;
		public static final int SCALE_CELL_H1280=285;
		public static final int SCALE_IMAGE_H1280=230;
		
		public static final int DEVICE_H800=800;
		public static final int DEVICE_H1024=1024;
		public static final int DEVICE_H1280=1280;
		
	}
	
	
}
